function png_bg_fixed(obj){
	var bg = obj.currentStyle.backgroundImage.toUpperCase();
	if (!bg) return;
	if (bg.match(/.PNG/i) != null){
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg.substring(5,bg.length-2)+"', sizingMethod='scale')";
		obj.style.backgroundImage = "url('')";
	}
}
function png_tag_fixed(obj){
	var imgName = obj.src.toUpperCase();
	if (imgName.substring(imgName.length-3, imgName.length) != 'PNG') return ;
	var imgStyle =  'width:' + obj.width + 'px; height:' + obj.height + 'px;'
		+((obj.align == 'left')?'float:left;':'')
		+((obj.align == 'right')?"float:right;":'')
		+((obj.parentElement.href)?'cursor:hand;':'')
		+'display:inline-block;' + obj.style.cssText
		+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'
		+"(src=\'" + obj.src + "\', sizingMethod='scale');";
	$("<span "
		+ ((obj.id) ? "id='" + obj.id + "' " : "")
		+ ((obj.className) ? "class='" + obj.className + "' " : "")
		+ ((obj.title) ? "title='" + obj.title + "' " : "title='" + obj.alt + "' ")
		+ " style=\"" + imgStyle + "\"></span>").replaceAll(o);
}

function reset_body(){
	var h = $(window).height();
	h = (h<680)?680:h;

	//fullbg.resize($(".fullbg_img"),w,h);
	//fullbg_b.resize($(".fullbg_b_img"),w,h);
}

var fullbg_b = (fullbg_b||{}).prototype={
	data:{},
	set:function(o,x,y){
		var src=$(o).attr("src");
		if (this.data[src]){//!=undefinde
			w = this.data[src].x;
			h = this.data[src].y;
		}else{
			w = $(o).width()||1920;
			h = $(o).height()||1080;
			$(o).css("display","block");
			this.data[src] = {x:w,y:h};
		}
		//if (w > x) { //图片宽度大于目标宽度时
			var w_original=w, h_original=h,left = 0;
			h = h * (x / w); //根据目标宽度按比例算出高度
			w = x; //宽度等于预定宽度

			if (h < y) { //如果按比例缩小后的高度小于预定高度时
				// w = w_original * (y / h_original); //按目标高度重新计算宽度
				h = y; //高度等于预定高度
				left = -(w-x)/2;
			}
		$(o).attr({width:w,height:h}).css("left",left+"px");
	},
	resize:function(o,x,h){
		x = x/2;
		o.each(function(){
			fullbg_b.set($(this),x>300?x:300,h);
		});
	}
};

function title_change(modfi,n_l,c_l)
{
	var b = c_l.eq(modfi).find(".tour_title").text();
	var month = ['一','一','二','二','三','三','四','四','五','五','六','六','七','七','八','八','九','九','十','十','十一','十一','十二','十二'];
	$("title").text(b+" - "+month[modfi]+"月");
	showbigbg(modfi,n_l,c_l);
}

function showbigbg(modfi,n_l,c_l){
	var b = c_l.eq(modfi).attr("_background");
	$("#bd").css("background","url("+b+") no-repeat center top");
}

//文章内容页面在弹出层时动态获取文章内容
function getart(t,o,type){
	if (type=="show"){
		var u = t.attr("_url");
		var a = $(".article_cont",o)
		a.hide().next().show();
		a.load(u,function(){
			a.show().next().hide("normal",function(){
				a.find(".art_text").attr('style','height:480px;position:relative;overflow:hidden;');
				jscroll_def3(a.find(".art_text"));
			});

		});
	}
}

//文章内容页面在弹出层时动态获取文章内容
function getpic(t,o,type){
	if (type=="show"){
		var u = t.attr("_pic");
		var a = $(".article_cont",o)
		a.find("img").attr("src",u);
	}
}


//文章内容页面在弹出层时动态获取文章内容
function getthisid(t,o,type){
	if (type=="show"){
		var vid = t.attr("_vid");
		//$(".navCls2 li").removeClass("ks-active");
		$(".ks-switchable-content").css({position: "absolute", width: "9999px", top:0});
		//$("#thisId_"+vid).addClass("ks-active");
		J_KCWidget.$["qqq"].fn.to(vid*1+1);
	}
}

//文章内容页面滚动条装载
function jscroll_def3(o){
	o = $(o).eq(0);
	if (o.height()<480) return;
	if ($(".jscroll-e",o)[0])return;
	o.height(480);
	  o.jscroll({
		   W:"15px"
		  ,BgUrl:"url(/statics/images/kc/s_bg3.gif)"
		  ,Bg:"right 0 repeat-y"
		  ,Bar:{Pos:"up"
				,Bd:{Out:"#a3c3d5",Hover:"#b7d5e6"}
				,Bg:{Out:"-45px 0 no-repeat",Hover:"-58px 0 no-repeat",Focus:"-71px 0 no-repeat"}}
				,Btn:{btn:false
					  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
					  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
		  ,Fn:function(){}
		});
}

//文章内容页面滚动条装载
function jscroll_def4(o){
	o = $(o).eq(0);
	if (o.height()<340) return;
	if ($(".jscroll-e",o)[0])return;
	if($(".company_tit")){
		o.height(260);
	}else{
		o.height(340);
	}
	o.jscroll({
		   W:"15px"
		  ,BgUrl:"url(/statics/images/kc/s_bg6.gif)"
		  ,Bg:"right 0 repeat-y"
		  ,Bar:{Pos:"up"
				,Bd:{Out:"#a3c3d5",Hover:"#b7d5e6"}
				,Bg:{Out:"-45px 0 no-repeat",Hover:"-58px 0 no-repeat",Focus:"-71px 0 no-repeat"}}
				,Btn:{btn:true
					  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
					  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
		  ,Fn:function(){}
		});
}
$(function(){
	var o=$(".sh_text");
	jscroll_def4(o);
})

//医疗健康项目页面手风琴回调
function showscroll(n,p){
	jscroll_def($(".sheep_content",p));
	var l = $(p).parents(".layout");
	var c = $(".col-sub",l).html("");
	$(".hidden_colsub",p).clone().appendTo(c);//向侧边栏传递动态内容
	if (!(c.html()))return ;
	if (c.html().length>0)
	{
		//l.addClass("grid-m0s85").removeClass("grid-m");//打开侧边
		c.show();
		$(".J_KCWidget",c).J_KCWidget();
		$(".colsub_content").attr('style','height:360px;position:relative;overflow:hidden;');
		jscroll_def5($(".colsub_content"));
	}else{
		//l.addClass("grid-m").removeClass("grid-m0s85");//关闭侧边
		c.hide();
	}
}

//医疗健康项目页面手风琴滚动条装载
function jscroll_def(o){
	o = $(o).eq(0);
	if (o.height()<340) return;
	if ($(".jscroll-e",o)[0])return;
	o.height(340);
	  o.jscroll({
		   W:"15px"
		  ,BgUrl:"url(/statics/images/kc/s_bg5.gif)"
		  ,Bg:"right 0 repeat-y"
		  ,Bar:{Pos:"up"
				,Bd:{Out:"#a3c3d5",Hover:"#b7d5e6"}
				,Bg:{Out:"-45px 0 no-repeat",Hover:"-58px 0 no-repeat",Focus:"-71px 0 no-repeat"}}
				,Btn:{btn:true
					  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
					  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
		  ,Fn:function(){}
		});
}

//医疗健康项目页面侧边滚动条装载
function jscroll_def2(o){
	o = $(o).eq(0);
	if (o.height()<200) return;
	if ($(".jscroll-e",o)[0])return;
	o.height(200);
	  o.jscroll({
		   W:"15px"
		  ,P:"left"
		  ,BgUrl:"url(/statics/images/kc/s_bg4.gif)"
		  ,Bg:"right 0 repeat-y"
		  ,Bar:{Pos:"up"
				,Bd:{Out:"#a3c3d5",Hover:"#b7d5e6"}
				,Bg:{Out:"-45px 0 no-repeat",Hover:"-58px 0 no-repeat",Focus:"-71px 0 no-repeat"}}
				,Btn:{btn:true
					  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
					  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
		  ,Fn:function(){}
		});
	$(".kc_sleep_phylogeny .jscroll-e").css("top","-10px");
}

// 健康医疗旅行滚动侧栏小内容滚动条
function jscroll_def5(o){
	$(o).each(function(){
		if ($(this).height()<360) return;
		if ($(".jscroll-e",$(this))[0])return;
		$(this).height(360);
		  $(this).jscroll({
			   W:"15px"
			  ,BgUrl:"url(/statics/images/kc/s_bg3.gif)"
			  ,Bg:"right 0 repeat-y"
			  ,Bar:{Pos:"up"
					,Bd:{Out:"#a3c3d5",Hover:"#b7d5e6"}
					,Bg:{Out:"-45px 0 no-repeat",Hover:"-58px 0 no-repeat",Focus:"-71px 0 no-repeat"}}
					,Btn:{btn:false
						  ,uBg:{Out:"0 0",Hover:"-15px 0",Focus:"-30px 0"}
						  ,dBg:{Out:"0 -15px",Hover:"-15px -15px",Focus:"-30px -15px"}}
			  ,Fn:function(){}
			});
	});
}

function changattr(){
	var pageitem = $(".list_pages a");
	pageitem.each(function(i){
		if($(this).attr("href") != undefined && $(this).attr("href") != null){
			$(this).attr("_url",$(this).attr("href"));
		}
	});
	pageitem.attr('href',"javascript:;");
}

function footpop(t,o){
	if(o.css("display") == "block"){
		o.animate({top:"-170px"});
	}else{
		o.css("display","block");
		o.animate({top:"27px"});
	}
}

//动态图片大小
var fullbg = (fullbg||{}).prototype={
	data:{},
	set:function(o,x,y){
		var src=$(o).attr("src");
		if (this.data[src]){//!=undefinde
			w = this.data[src].x;
			h = this.data[src].y;
		}else{
			w = $(o).width()||1920;
			h = $(o).height()||1080;
			$(o).css("display","block");
			this.data[src] = {x:w,y:h};
		}
		//if (w > x) { //图片宽度大于目标宽度时
			var w_original=w, h_original=h,left = 0;
			h = h * (x / w); //根据目标宽度按比例算出高度
			w = x; //宽度等于预定宽度
			if (h < y) { //如果按比例缩小后的高度小于预定高度时
				w = w_original * (y / h_original); //按目标高度重新计算宽度
				h = y; //高度等于预定高度
				left = -(w-x)/2;
			}
		$(o).attr({width:w,height:h}).css("left",left+"px");
	},
	resize:function(o,x,h){
		o.each(function(){
			fullbg.set($(this),x>1024?x:1024,h);
		});
	}
};



function resetimgbg(o,h){
}
var window_height = 0;
$(document).ready(function() {
	//$("body").wrapInner("<div id='maxbody' style='width:2560px;'></div>");


	//自定义
	$('.list_team > li').hover(function(){
		$(this).find('.hover').css('display','block');
	},function(){
		$(this).find('.hover').css('display','none');
	});

	$('.imgs li a').click(function(){
		$('.show').css('display','block');
	});
	$('.close').click(function(){
		$('.show').hide();
	})


	$(".J_KCWidget").J_KCWidget();
	if(!window.XMLHttpRequest){
		$(".pngbg").each(function(){
				png_bg_fixed($(this)[0]);
		});
		$(".pngtag").each(function(){
				png_tag_fixed($(this)[0]);
		});
	}

	reset_body();


	changattr();
	var pageitem = $(".list_pages a");
	pageitem.live("click",function(){
		var u = $(this).attr("_url");
		var a = $("#activity_list")
		a.load(u + " #activity_list .news_list",function(){
			changattr();
			$(".detail_conent").J_KCWidget();
		});
	});





});



$(window).resize(function() {
	reset_body();
});


//自定义
